<script setup>
	import DateTabs from '@/uni_modules/hope-11-date-tabs-v3/components/hope-11-date-tabs-v3/hope-11-date-tabs-v3.vue'
	import { ref } from 'vue'
	
	const timeSelected = ref('')
	const projectSelected = ref('')
	const onDateTabsChange = (e) => {
	    console.log(e)
	}
	const timeSelect = (e) => {
		// console.log(e)
		if (e === timeSelected.value) {
			timeSelected.value = ''
		}else {
			timeSelected.value = e
		}
		// console.log(timeSelected.value)
	}
	const projectSelect = (e) => {
		// console.log(e)
		if (e === projectSelected.value) {
			projectSelected.value = ''
		}else {
			projectSelected.value = e
		}
		// console.log(projectSelected.value)
	}
</script>

<template>
	<view class="title">
		<image class="icon" src="../../static/yuyue/date.png" mode=""></image>
		<span class="tips">请选择预约日期</span>
	</view>
	<view>
		<DateTabs color="#00c8a4" @change='onDateTabsChange'></DateTabs>
	</view>
	<view class="title">
		<image class="icon" src="../../static/yuyue/time.png" mode=""></image>
		<span class="tips">请选择到店时间</span>
	</view>
	<view class="time">
		<view :class="timeSelected == 'am' ? 'ampm-on' : 'ampm'" @click="timeSelect('am')">
			上午
		</view>
		<view :class="timeSelected == 'pm' ? 'ampm-on' : 'ampm'" @click="timeSelect('pm')">
			下午
		</view>
	</view>
	<view class="title">
		<image class="icon" src="../../static/yuyue/project.png" mode=""></image>
		<span class="tips">请选择服务项目</span>
	</view>
	<view class="time">
		<view :class="projectSelected == 'lf' ? 'ampm-on' : 'ampm'" @click="projectSelect('lf')">
			理发
		</view>
		<view :class="projectSelected == 'xf' ? 'ampm-on' : 'ampm'" @click="projectSelect('xf')">
			洗发
		</view>
		<view :class="projectSelected == 'rf' ? 'ampm-on' : 'ampm'" @click="projectSelect('rf')">
			染发
		</view>
		<view :class="projectSelected == 'tf' ? 'ampm-on' : 'ampm'" @click="projectSelect('tf')">
			烫发
		</view>
		<view :class="projectSelected == 'hf' ? 'ampm-on' : 'ampm'" @click="projectSelect('hf')">
			护发
		</view>
		<view :class="projectSelected == 'mr' ? 'ampm-on' : 'ampm'" @click="projectSelect('mr')">
			美容
		</view>
		<view :class="projectSelected == 'am' ? 'ampm-on' : 'ampm'" @click="projectSelect('am')">
			按摩
		</view>
	</view>
	<view class="title">
		<image class="icon" src="../../static/yuyue/remark.png" mode=""></image>
		<span class="tips">请填写备注信息</span>
	</view>
	<view class="time">
		<uni-easyinput type="textarea" value="" placeholder="请输入备注信息" />
	</view>
	<button class="loginbtn" type="submit" style="margin-bottom: 80rpx;">预约</button>
</template>

<style>
	.title {
		padding: 30rpx;
		/* width: 100%;
		height: auto; */
		display: flex;
		align-items: center;
		.icon {
			width: 40rpx;
			height: 40rpx;
		}  
		 .tips {
			 font-size: 30rpx;
			 padding-left: 10rpx;
		 }
	}
	.time {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-around;
		padding: 0 30rpx;
		/* margin: 20rpx; */
		.ampm {
			width: 200rpx;
			height: 60rpx;
			justify-content: center;
			display: flex;
			align-items: center;
			background-color: white;
			margin: 15rpx 0;
			/* border: 1rpx solid red; */
		}
		.ampm-on {
			width: 200rpx;
			height: 60rpx;
			justify-content: center;
			display: flex;
			align-items: center;
			background-color: #00c8a4;
			margin: 15rpx 0;
			box-shadow: 5rpx 5rpx 5rpx 0 rgba(0, 240, 240, 0.6);
			/* border: 1rpx solid red; */
		}
	}
	.loginbtn {
		background-color: #00c8a4;
		margin: 30rpx 30rpx;
	}
</style>
